//
//  PKNewFeatureViewCell.swift
//  Panku
//
//  Created by mac on 2017/2/7.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit
import SnapKit
import YYKit

class PKNewFeatureViewCell: UICollectionViewCell {
    
    //MARK: - properties
    lazy var imageView = UIImageView()
    lazy var enterButton = UIButton(type: .custom)
    
    //MARK: - init
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentView.addSubview(imageView)
        contentView.addSubview(enterButton)
        
        imageView.snp.makeConstraints { (make) in
            make.edges.equalTo(contentView)
        }
        
        enterButton.setTitleColor(UIColor.black, for: .normal)
        enterButton.layer.borderWidth = 1
        enterButton.layer.borderColor = UIColor.black.cgColor
        enterButton.layer.cornerRadius = 3
        enterButton.layer.masksToBounds = true
        enterButton.setTitle("进入", for: .normal)
        enterButton.backgroundColor = UIColor.white
        enterButton.isHidden = true
        
        enterButton.snp.makeConstraints { (make) in
            make.centerX.equalTo(contentView.snp.centerX)
            make.width.equalTo(100*D_FACTOR_X)
            make.height.equalTo(50*D_FACTOR_Y)
            make.bottom.equalTo(contentView.snp.bottom).offset(-30*D_FACTOR_Y)
        }
        
        enterButton.addBlock(for: .touchUpInside) { (_) in
            PKNewFeatureView.dismiss()
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
